package com.sfh.cpc.note.model;

import android.content.Context;

import com.sfh.cpc.com.entity.ENote;
import com.sfh.cpc.com.entity.RspBase;
import com.sfh.cpc.com.req.ReqNoteFabulous;
import com.sfh.cpc.com.server.INoteServer;
import com.sfh.cpc.mass.MyMassActivity;
import com.sfh.cpc.note.UserNoteActivity;
import com.sfh.cpc.note.NoteActivity;
import com.sfh.lib.exception.HandleException;
import com.sfh.lib.rx.IResult;
import com.sfh.lib.rx.RetrofitManager;

import io.reactivex.disposables.Disposable;

/**
 * 功能描述: TODO
 *
 * @date 2018/8/30
 */
public class NoteServer implements INoteServer {

    Disposable disposable;

    @Override
    public void addFabulous(long noteId) {
        RetrofitManager.executeSigin(new ReqNoteFabulous(noteId).getTask(), new IResult<RspBase>() {
            @Override
            public void onFail(HandleException e) {

            }

            @Override
            public void onSuccess(RspBase rspBase) throws Exception {

            }
        });

    }

    @Override
    public void openNote(Context context, ENote note) {
        NoteActivity.startUI(context, note);
    }

    @Override
    public void openUserNote(Context context, long userId) {
        UserNoteActivity.startUI(context, userId);
    }

    @Override
    public void openMyMass(Context context) {
        MyMassActivity.startUI(context);
    }

}
